﻿using System.Collections.Generic;

namespace FlashPay.Service.Interface
{
    using FlashPay.EF.Models;
    using FlashPay.Entity;
    using FlashPay.Entity.Parameter;
    using FlashPay.Entity.Request;
    using FlashPay.Entity.Request.Bank;
    using FlashPay.Entity.Request.Payment;
    using FlashPay.Entity.Response;
    using FlashPay.Entity.Response.Bank;
    using FlashPay.Entity.Response.BankCard;
    using FlashPay.Entity.Response.Company;

    /// <summary>
    /// 银行业务接口
    /// </summary>
    public interface BankService
    {
        /// <summary>
        /// 获取所有銀行卡记录
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>List<CardMerchant></returns>
        BankResponse Get(int bcId);

        /// <summary>
        /// 获取所有銀行卡记录
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>List<CardMerchant></returns>
        BankResponse Get(int companyId, int bcId, List<string> userPermission);

        /// <summary>
        /// 银行卡修改
        /// </summary>
        /// <param name="request">参数</param>
        JResult EditOrAdd(BankEditOrAddRequest request);

        /// <summary>
        /// 添加、修改银行卡
        /// </summary>
        /// <param name="request"></param>
        JResult StockCardAddOrEdit(StockCardAddOrEditRequest request);

        /// <summary>
        /// 更改银行卡启用状态
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        JResult UpdateEnableStatus(int bcId, sbyte enableStatus, string userName);

        /// <summary>
        /// 更改银行卡启用状态
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        JResult StockCardDelete(int bcId);

        /// <summary>
        /// 作废
        /// </summary>
        /// <param name="bcId"></param>
        /// <returns></returns>
        JResult Obsolete(int bcId);

        /// <summary>
        /// 作废卡还原
        /// </summary>
        /// <param name="bcId">系统编号</param>
        /// <returns></returns>
        JResult Restitute(int bcId);

        /// <summary>
        /// 获取所有銀行卡记录
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>List<CardMerchant></returns>
        List<BankCard> GetList(BankQuery query);

        /// <summary>
        /// 根据编号获取公司
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns>Company</returns>
        List<CompanyResponse> GetCompany(int companyId, int level = 2);

        /// <summary>
        /// 银行卡分页
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        DataGrid<BankPagerResponse> GetPager(BankQuery query);

        /// <summary>
        /// 库存卡查询
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        DataGrid<SpareBankCardResponse> GetSparePager(StockQuery query);

        /// <summary>
        /// 更改银行卡启用状态
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        JResult UpdateAuthStatus(int bcId, sbyte enableStatus);

        /// <summary>
        /// 付款卡修改
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        JResult PaymentCardEdit(PaymentCardEditRequest request);

        /// <summary>
        /// 库存卡分页
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        DataGrid<B2BSpareBankCardResponse> GetB2BSparePager(B2BSpareBankCardQuery query);

        /// <summary>
        /// 银行卡分页
        /// </summary>
        /// <param name="query">查询参数</param>
        /// <returns></returns>
        DataGrid<B2BBankCardResponse> GetB2BPager(B2BBankCardQuery query);

        /// <summary>
        /// B2B银行卡[添加、修改]
        /// </summary>
        /// <param name="request">参数</param>
        JResult B2BEditOrAdd(BankEditOrAddRequest request);

        /// <summary>
        /// B2B库存卡[添加、修改]
        /// </summary>
        /// <param name="request"></param>
        JResult B2BStockCardAddOrEdit(StockCardAddOrEditRequest request);

        /// <summary>
        /// B2B库存卡[更新授权状态]
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        JResult B2BUpdateAuthStatus(int bcId, sbyte enableStatus);

        /// <summary>
        /// B2B更改库存卡启用状态
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        JResult B2BStockCardDelete(int bcId);

        /// <summary>
        /// B2B银行卡[更改启用状态]
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        JResult B2BUpdateEnableStatus(int bcId, sbyte enableStatus);

        /// <summary>
        /// 更新AdjustBalanceRID
        /// </summary>
        /// <returns></returns>
        JResult UpdateAdjustBalanceRID(long rid);

        /// <summary>
        /// 安全卡[添加、修改]
        /// </summary>
        /// <param name="request"></param>
        JResult SafeCardAddOrEdit(StockCardAddOrEditRequest request);

        /// <summary>
        /// 作废卡
        /// </summary>
        /// <param name="request"></param>
        PagedList<ObsoleteBankCardResponse> GetObsoleteBankCard(ObsoleteBankCardQuery query);

        /// <summary>
        /// 获取有效银行卡
        /// </summary>
        /// <param name="query">查询参数</param>
        /// <returns></returns>
        PagedList<ValidCardResponse> GetValidCard(ValidCardQuery query);

    }
}
